package com.faithbj.common.utils;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 计算某个状态的截止日期
 * @author rym
 *
 */
public class StateEndTimeUtil {

	/**
	 * NEW_ARRIVAL(1L, "业务受理"),
    COMPLETION(2L, "信息录入"),
    VERIFICATION(3L, "信息核实", "对应街镇核实"),
    EXPORT(4L, "信息导出"),
    IMPORT(5L, "信息导入"),
    SEND_AND_RECEIVE_FOR_COMPARISON(6L, "比对信息发送接收"),
    COMPARISON(7L, "准入标准核实比对"),
    COMPARISON_DONE(8L, "准入标准已核实"),
    FIRST_CHECK(9L, "比对审核", "对应一次审核"),
    FIRST_CHECK_MODIFICATION(10L, "修改核定值"),
    CHECK_TABLE_GENERATED(11L, "生成核对表"),
    DIFF_TABLE_GENERATED(12L, "生成差异表"),
    SECOND_CHECK(13L, "抽查", "对应二次审核"),
    REPORT(14L, "生成核对报告"),
    INTERRUPTED(15L, "中止核对"),
    TERMINATED(16L, "流程正常结束"),
    CANCELLED(17L, "自愿退出申请"),
    KILLED(18L, "强制结束流程");
	 */
	
	public static Map<Long, Integer> STATEPROCESSDAYS = new HashMap<Long, Integer>();
	static {
		STATEPROCESSDAYS.put(1L, 10);
		STATEPROCESSDAYS.put(2L, 10);
		STATEPROCESSDAYS.put(3L, 10);
		STATEPROCESSDAYS.put(4L, 10);
		STATEPROCESSDAYS.put(5L, 10);
		STATEPROCESSDAYS.put(6L, 10);
		STATEPROCESSDAYS.put(7L, 10);
		STATEPROCESSDAYS.put(8L, 10);
		STATEPROCESSDAYS.put(9L, 10);
		STATEPROCESSDAYS.put(10L, 10);
		STATEPROCESSDAYS.put(11L, 10);
		STATEPROCESSDAYS.put(12L, 10);
		STATEPROCESSDAYS.put(13L, 10);
		STATEPROCESSDAYS.put(14L, 10);
		STATEPROCESSDAYS.put(15L, 10);
		STATEPROCESSDAYS.put(16L, 10);
		STATEPROCESSDAYS.put(17L, 10);
		STATEPROCESSDAYS.put(18L, 10);
	}
	/**
	 * 获取某个状态的截止日期
	 * @param stateId
	 * @param startDate
	 * @return
	 */
	public static Date getEndDate(Long stateId, Date startDate) {
		int processDays = STATEPROCESSDAYS.get(stateId);
		Date endDate = DateUtils.dateAddDays(startDate, processDays); 
		return endDate;
	}
	
	public static void main(String [] args) {
		System.out.println(getEndDate(1L, new Date()));
	}
}
